     public List<String> binaryTreePaths(TreeNode root) {
   	List<String> res = new ArrayList<>();
    backTrace("", root);
    return res;
   }

   private void backTrace(String path, TreeNode root) {
      if (root == null) {
         return;
      }
      path += String.valueOf(root.val);
      if (root.left == null && root.right == null) {
         res.add(path);
         return;
      }
      path += "->";
      backTrace(path, root.left);
      backTrace(path, root.right);
   }
